﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Keepo.Models;
using System.ComponentModel.DataAnnotations;

namespace AlbumDesigner.Models.Types
{
    public class BackgroundImageData
    {
        public long BackgroundImageId { get; set; }

        [Required(ErrorMessage="יש להזין כותרת")]
        public string Title { get; set; }
        public string ThumbnailUrl { get; set; }
        public int? CategoryId { get; set; }
        public bool IsRepeat { get; set; }
        public bool IsSingle { get; set; }

        public BackgroundImageData()
        {

        }

        public BackgroundImageData(BackgroundImage image)
        {
            this.BackgroundImageId = image.DesignImageId;
            this.Title = image.Title;
            this.ThumbnailUrl = image.ThumbnailUrl;
            this.CategoryId = image.ImageCategoryId;
            if (image.IsRepeat != null)
            {
                this.IsRepeat = image.IsRepeat.Value;
            }
            this.IsSingle = image.IsSingle;
        }
    }
}